#ifndef CARDGRAPHICSITEM_H
#define CARDGRAPHICSITEM_H

#include <QObject>
#include <QGraphicsPixmapItem>

class CardListModel;

class CardGraphicsItem : public QObject, public QGraphicsPixmapItem
{
Q_OBJECT
private:
    QString m_multiverseId;
    bool tapped;

    QString powerAndThouthness;

    virtual void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * event );
    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);


    virtual QRectF boundingRect () const;
    virtual bool contains ( const QPointF & point ) const;
    virtual void paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget );

    void shrink(CardListModel *destiny, bool top=false);
public:
    explicit CardGraphicsItem(const QString &multiverseId);

    QString multiverseId() const { return m_multiverseId; }

    Q_PROPERTY(qreal scale READ scale WRITE setScale);
    Q_PROPERTY(qreal rotation READ rotation WRITE setRotation);
public slots:
    void changePixmap ( const QPixmap & pixmap ) {
        setPixmap(pixmap);
    }

    void setPowerAndThouthness();

    void sendToHand();
    void sendToLibraryTop();
    void sendToLibraryBottom();
    void sendToGraveyard();
    void sendExile();
    void sendToBattleField();

    void animationFinished();
};

#endif // CARDGRAPHICSITEM_H
